
<div class="btn-group">
    <a href="<?php echo site_urlc('app/index')?>" class='btn'> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?></a>
</div>

<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-pencil"></i> <span class="badge badge-success pull-right"><?php echo $title; ?></span> <?php echo lang('add') ?></h3>
    <?php echo form_open(current_urlc(),array("class"=>"form-horizontal","id"=>"frm-create")); ?>

    <div class="boxed-inner seamless">
        <div class="control-group">
            <label class="control-label" for="version"> 版本号 </label>
            <div class="controls">
                <input type="text" id="version" name="version" class='span7'>
            </div>
        </div>
        <!-- ctype -->
        <?php if ($ctype = list_coltypes($this->cid)) { ?>
            <div class="control-group">
                <label class="control-label" for="status"> 所属分类:</label>
                <div class="controls">
                    <?php
                    echo ui_btn_select('ctype',set_value("ctype"),$ctype);
                    ?>
                    <span class="help-inline"></span>
                </div>
            </div>
        <?php } ?>
        <div class="control-group">
            <label class="control-label" for="url"> 下载地址 </label>
            <div class="controls">
                <input type="text" id="url" name="url" class='span7'>
            </div>
        </div>


        <!-- 图片上传 -->
        <div class="control-group">
            <label for="img" class="control-label">视频：</label>
            <div class="controls">
                <div class="btn-group">
					<span class="btn btn-success">
						<i class="fa fa-upload"></i>
						<span> <?php echo lang('upload_file') ?>  </span>
						<input class="fileupload" type="file" accept="" data-for="files"  >
					</span>
                    <input type="hidden" name="files" class="form-upload" data-more="0" value="">

                </div>
            </div>
        </div>
        <div id="js-files-show" class="js-img-list-f">
        </div>
        <div class="clear"></div>
        <!-- 图片上传 -->

    </div>

    <div class="boxed-footer">
        <?php if ($this->ccid): ?>
            <input type="hidden" name="ccid" value="<?php echo $this->ccid ?>">
        <?php endif ?>
        <input type="hidden" name="cid" value="<?php echo $this->cid ?>">
        <input type="submit" value=" <?php echo lang('submit'); ?> " class='btn btn-primary'>
        <input type="reset" value=' <?php echo lang('reset'); ?> ' class="btn btn-danger">
    </div>
</form>
</div>

<?php include_once 'inc_ui_media.php'; ?>
<script type="text/javascript">
    require(['jquery','adminer/js/ui','adminer/js/media'],function($,ui,media){
        // media 上传
        media.init();

        var articles_files = <?php echo json_encode(one_upload(set_value("files"))) ?>;
        media.show(articles_files,"files");
  });
</script>
